package com.neusoft.tyut.elm.service.impl;

import java.util.List;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.neusoft.tyut.elm.dao.IBusinessDao;
import com.neusoft.tyut.elm.dao.impl.BusinessDaoImpl;
import com.neusoft.tyut.elm.entity.Business;
import com.neusoft.tyut.elm.service.IBusinessService;

public class BusinessServiceImpl implements IBusinessService {	
	private final IBusinessDao businessDao =new BusinessDaoImpl();
	@Override
	public String findAll() {	
		List<Business> lbs =  businessDao.findAll();
		
		ObjectMapper mapper = new ObjectMapper();
		String string ="";
		try {
			string = mapper.writeValueAsString(lbs);
		} catch (JsonProcessingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return string;
	}

}
